﻿using System;

namespace Aop.Autofac.Core.Attributes
{
    [AttributeUsage(AttributeTargets.Parameter | AttributeTargets.ReturnValue)]
    public class NotEmptyGuidAttribute: OnMethodArgumentBoundedAspect
    {
        public override void CheckArgument(string argumentName, object value)
        {
            var guid = (Guid)value;
            if (guid == Guid.Empty)
            {
                throw new ArgumentException(argumentName);
            }
        }
    }
}
